load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "reports",
    srcs = [
        "constraint_stats_report.go",
        "critical_localities_report.go",
        "replication_stats_report.go",
        "reporter.go",
        "zone_key.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/reports",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/allocator/storepool",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/descbuilder",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/isql",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
    ],
)

go_test(
    name = "reports_test",
    size = "medium",
    srcs = [
        "constraint_stats_report_test.go",
        "critical_localities_report_test.go",
        "helpers_test.go",
        "main_test.go",
        "replication_stats_report_test.go",
        "reporter_test.go",
    ],
    embed = [":reports"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descbuilder",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/isql",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/testutils/keysutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/keysutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//proto",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
